package com.itany.cloud.util;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 石小俊
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "接口响应的JSON数据")
public class ResponseResult {

    @Schema(description = "业务逻辑状态码。详情请查考状态码手册")
    private String responseCode;
    @Schema(description = "响应信息")
    private String message;
    @Schema(description = "响应的数据")
    private Object returnObject;

    public static ResponseResult success(){
        ResponseResult result = new ResponseResult();
        result.setResponseCode("2001");
        result.setMessage("成功");
        return result;
    }

    public static ResponseResult success(Object returnObject){
        ResponseResult result = new ResponseResult();
        result.setResponseCode("2001");
        result.setMessage("成功");
        result.setReturnObject(returnObject);
        return result;
    }

}
